apiready = function () {
  api.parseTapmode();
  FastClick.attach(document.body);
  var header = $api.byId('aui-header');
  $api.fixStatusBar(header);
  // api.setRefreshHeaderInfo({
  //     loadingImg: 'widget://image/refresh.png',
  //     bgColor: '#fdd903',
  //     textColor: '#fff',
  //     textDown: '下拉刷新...',
  //     textUp: '松开刷新...'
  // }, function(ret, err) {
  //
  //  pageMoreUrl.init()
  //     //在这里从服务器加载数据，加载完成后调用api.refreshHeaderLoadDone()方法恢复组件到默认状态
  // });

  var pageMoreUrl= new Vue({
        el: '#pageMoreUrl',
        data: {
          data: {},
          userInfo:{},
          urls:[],
          leastUrls:[]
        },
        created: function() {
           this.userInfo = app.getUserInfo();
          //  console.log(created);

           this.init();
          //  this.onReload();
        },
         methods: {
               init:function(){
                 var that = this;
                 this.getUrls();
              },



              getUrls:function(){
                var that = this;
                app.get("apiv2/app_index_url/get",{
                  from:'getUrls',
                  type:'moreUrl',
                  order:'order_by'
                },function(res){
                  //  api.refreshHeaderLoadDone();
                   if(res.code!=200){
                      app.alert(res.msg);
                     return ;
                   }else{
                     that.urls=res.data.list;
                   }
                  //  app.log("urls",that.urls);
                });
              },
              saveLeastUrls:function(id){
                var that = this;
                app.get("apiv2/app_index_url/add",{
                  store_id:this.userInfo.store_id,
                  id:id,
                  order:'updatetime desc'
                },function(res){
                   if(res.code!=200){
                      app.alert(res.msg);
                     return ;
                   }
                });
              },
              openUrl:function(url,title,id){
                  this.saveLeastUrls(id);
                  if(url.indexOf("http")===0){
                     webView(url,title);
                  }else{
                     openFrame(url,url,1);
                  }
              }
         }

  })
}
